﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GUIServerConnectorAPI
{
    /// <summary>
    /// The IAuthenticator interface provides authentication functionality for all user roles.
    /// </summary>
    public interface IAuthenticator
    {
        /// <summary>
        /// Used by users to perform login. The method checks the userName and password hash and, if the authentification succeeds, starts a new session for the user
        /// </summary>
        /// <param name="userName">The user name</param>
        /// <param name="passwordHash">The MD5 hash value of the password</param>
        /// <returns>The data associated with the newly created session</returns>
        LoginData login(string userName, byte[] passwordHash);

        /// <summary>
        /// Used by users to perform logout. The method checks if the session identified by the specified ID is active and, if true, ends the session and invalidates the session ID
        /// </summary>
        /// <param name="sessionId">The ID of the active session</param>
        void logout(Guid sessionId);
    }
}
